
#CC=arm-linux-gnueabihf-
CC = gcc
CXX = g++
LIB_FILE = libwebsocket_if.so.0
LIBRARY_DIR = ../websocket 
INCLUDE_DIR = ../websocket
SERVER_CPP = main_server.cpp websocket_handler.cpp  myDB.cpp imDB.cpp execjson.cpp myconfig.cpp
target:
#	$(CC) -O3 -o client_test client_main.c ../websocket/websocket_client.c ../websocket/websocket_common.c -lpthread
#	$(CC) -O3 -o server_test server_main.c -L. -lwebsocket -lpthread	-lmysqlcppconn
	$(CXX)  $(SERVER_CPP) -fpermissive  -L. -lwebsocket_if -ljsoncpp -lmysqlclient  -o wsserver
	$(CXX)  myDB.cpp imDB.cpp myconfig.cpp  imctl.cpp -fpermissive -L. -ljsoncpp -lmysqlclient -o wsimctl
	$(CXX)	wsstatus.cpp -fpermissive -L. -o wsstatus
	$(CXX)  main_client.cpp  -L. -lwebsocket_if -ljsoncpp -lpthread -o wsclient
	cp -rf wsclient ../client/deb/application/wsclient
	@rm -rf *.o
.PHONY:clean

clean:
	@rm -rf client_test server_test wsserver wsclient wsstatus wsimctl
install:
	#cp websocket_common.h $(INCLUDE_DIR)/websocket_common.h
	#chmod a+x $(INCLUDE_DIR)/websocket_common.h
	#cp $(LIB_FILE) $(LIBRARY_DIR)/$(LIB_FILE)
	#chmod a+x $(LIBRARY_DIR)/$(LIB_FILE)
uninstall:
	#@rm -rf $(INCLUDE_DIR)/websocket_common.h
	#@rm -rf $(LIBRARY_DIR)/$(LIB_FILE)
